<?php

class TransferenciaController extends Zend_Controller_Action
{

	public function importarAction(){

		$form = new Form_Importacao();

		if (($post = $this->_request->getPost()) != array())
		{
			if ($form->isValid($post)){
				$transferencia = new Transferencia();
				$dados = $transferencia->importar();
				$this->view->contadorCadastradas =$dados['ContadorCadastrados'];
				$this->view->existentes =$dados['Existentes'];
			}

		}

		$this->view->form = $form;
	}

	public function exportarAction(){

		$transferencia = new Transferencia();
		try {
			$this->_helper->layout->disableLayout();
			$this->_helper->viewRenderer->setNoRender();
			$transferencia->exportar($this->_getAllParams());
		} catch (Exception $e) {
			echo $e->getMessage();
		}
		
		
	}


}
